package cc.idoone.handlermapping.version;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

//@Controller
//@RequestMapping("/api")
public class ApiVersionController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello1(HttpServletRequest request) {
        System.out.println("haha1..........");

        return "hello1";
    }

    @ApiVersion(2)
    @RequestMapping("/hello")
    @ResponseBody
    public String hello2(HttpServletRequest request) {
        System.out.println("haha2..........");

        return "hello2";
    }

    @ApiVersion(3)
    @RequestMapping("/hello")
    @ResponseBody
    public String hello3(HttpServletRequest request) {
        System.out.println("haha3.........");

        return "hello3";
    }

    @ApiVersion(15)
    @RequestMapping("/hello")
    @ResponseBody
    public String hello15(HttpServletRequest request) {
        System.out.println("haha15.........");

        return "hello15";
    }

}
